@using Extension.k8s
@using k8s.Models
@inherits BlazorApp.Pages.Common.PageBase

@if (Pods != null)
{
    <p>@NodeName @Pods.ReadySummary()</p>
    @foreach (var pod in Pods)
    {
        var color = "processing";
        if (pod.Status() == "Running")
        {
            color = "success";
        }
        if (pod.Status() == "Succeeded")
        {
            color = "success";
        }
        if (pod.Status() == "Terminating")
        {
            color = "warning";
        }
        if (pod.Status() == "Failed")
        {
            color = "error";
        }
        var icon = pod.IsReady() ? "check-circle" : "clock-circle";
        <Tag Color="@color" OnClick="() => OnPodClick(pod)" Icon="@icon">@pod.Name()</Tag>
    }
}
